/**
 * 
 */
package neptune.web.client.view.components.editor;

import neptune.web.client.model.topology.SerializableNetworkInterface;
import neptune.web.client.model.topology.SerializableNode;
import neptune.web.client.model.topology.SerializableTopology;

import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.TreeItem;

/**
 * @author Roberto Bifulco [info@RobertoBifulco.it] [RobertoBifulco.it]
 * 
 */
public class ControlNetIFMenuBar extends NetworkIFMenuBar {

	public ControlNetIFMenuBar(SerializableNetworkInterface netIF,
			SerializableNode node, SerializableTopology topology, TreeItem item) {
		super(netIF, node, topology, item);

		MenuItem props = new MenuItem("Properties", new NetIFPropsCommand(
				netIF, node, topology, item));

		MenuBar options = new MenuBar(true);

		options.addItem(props);

		clearItems();

		mainItem = new MenuItem(netIF.getInterfaceName() + " [control]",
				options);
		addItem(mainItem);
		options.setStylePrimaryName("TopologyEditor-tree-NodeItem");
		this.setStylePrimaryName("TopologyEditor-tree-RootNodeItem");
	}

	@Override
	public void setText(String text) {
		super.setText(text + " [control]");
	}

}
